import "../context/java_context";

const Environment = (function() {
    function Environment() {}

    Environment.isDevelopment = function() {
        return JavaContext.inWebBrowser;
    };

    Environment.isProduction = function() {
        return !JavaContext.inWebBrowser;
    };

    Environment.useOnlineData = function() {
        return Setting.Environment != Setting.RuntimeEnvironment.ANDROID;
    };

    Environment.useLocaleData = function() {
        return Setting.Environment == Setting.RuntimeEnvironment.ANDROID
    };

    //数据目录
    Environment.getDataBasePath = function() {
        if (!this.useLocaleData()) {
            //测试数据服务地址
            //代理 见vue.config.js
            return "/mydata/";
        } else {
            //Android数据目录
            return "file:///storage/emulated/0/mev/BaseData/";
        }
    };

    return Environment;
})();

export default Environment;
